package com.ecut.xzh.mapper;

import com.ecut.xzh.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author XZH
 */
@Mapper
public interface UserMapper {

    /**
     * 用学号查询用户信息
     *
     * @param number
     * @return
     */
    @Select("select id,name,number,password from student where number = #{number}")
    User getByNumber(String number);

    /**
     *  查询手机号是否被注册
     * @param phone
     * @return
     */
    @Select("select count(*) from student where phone = #{phone}")
    int countByPhone(String phone);

    /**
     * 新增用户信息
     * @param userWithTime
     */
    void insert(User userWithTime);
}
